import { Text, View } from 'react-native';
import { Button, Input } from '@rneui/base';
import React, { useState } from 'react';




export  const CreateTodo = ({onAddTodo}) => {


  const [value,setValue]=useState('')
  function onPress(){
    onAddTodo(value);
  }

  return (
    <View style={[{display:'flex',flexWrap:'nowrap'}]}>
      <Input onChangeText={text=>setValue(text)} value={value}
             rightIcon={ <Button  onPress={onPress} title="添加" />} style={{width:50}} placeholder="待办事项"></Input>

    </View>
  );
};

